//对外暴露插件对象
import SvgIcon from '@/components/SvgIcon/index.vue'
import Pagination from '@/components/Pagination/index.vue'
// 引入饿了么plus
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

//定义全局组件对象
const allGloablComponent = { SvgIcon: SvgIcon, Pagination: Pagination }
export default {
  //必须叫install
  install(app: any) {
    Object.keys(allGloablComponent).forEach(item => {
      //@ts-ignore
      app.component(item, allGloablComponent[item])
    })
    // 饿了么plus图标挂载到全局
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  }
}
